\(\int \sec (a+b x) \tan ^2(a+b x) \, dx\) [63]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 34 \[ \int \sec (a+b x) \tan ^2(a+b x) \, dx=-\frac {\text {arctanh}(\sin (a+b x))}{2 b}+\frac {\sec (a+b x) \tan (a+b x)}{2 b} \]

[Out]

-1/2*arctanh(sin(b*x+a))/b+1/2*sec(b*x+a)*tan(b*x+a)/b

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {2691, 3855} \[ \int \sec (a+b x) \tan ^2(a+b x) \, dx=\frac {\tan (a+b x) \sec (a+b x)}{2 b}-\frac {\text {arctanh}(\sin (a+b x))}{2 b} \]

[In]

Int[Sec[a + b*x]*Tan[a + b*x]^2,x]

[Out]

-1/2*ArcTanh[Sin[a + b*x]]/b + (Sec[a + b*x]*Tan[a + b*x])/(2*b)

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\sec (a+b x) \tan (a+b x)}{2 b}-\frac {1}{2} \int \sec (a+b x) \, dx \\ & = -\frac {\text {arctanh}(\sin (a+b x))}{2 b}+\frac {\sec (a+b x) \tan (a+b x)}{2 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00 \[ \int \sec (a+b x) \tan ^2(a+b x) \, dx=-\frac {\text {arctanh}(\sin (a+b x))}{2 b}+\frac {\sec (a+b x) \tan (a+b x)}{2 b} \]

[In]

Integrate[Sec[a + b*x]*Tan[a + b*x]^2,x]

[Out]

-1/2*ArcTanh[Sin[a + b*x]]/b + (Sec[a + b*x]*Tan[a + b*x])/(2*b)

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.41

method result size
derivativedivides \(\frac {\frac {\sin ^{3}\left (b x +a \right )}{2 \cos \left (b x +a \right )^{2}}+\frac {\sin \left (b x +a \right )}{2}-\frac {\ln \left (\sec \left (b x +a \right )+\tan \left (b x +a \right )\right )}{2}}{b}\) \(48\)
default \(\frac {\frac {\sin ^{3}\left (b x +a \right )}{2 \cos \left (b x +a \right )^{2}}+\frac {\sin \left (b x +a \right )}{2}-\frac {\ln \left (\sec \left (b x +a \right )+\tan \left (b x +a \right )\right )}{2}}{b}\) \(48\)
risch \(-\frac {i \left ({\mathrm e}^{3 i \left (b x +a \right )}-{\mathrm e}^{i \left (b x +a \right )}\right )}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (b x +a \right )}+i\right )}{2 b}+\frac {\ln \left ({\mathrm e}^{i \left (b x +a \right )}-i\right )}{2 b}\) \(78\)
parallelrisch \(\frac {\left (1+\cos \left (2 b x +2 a \right )\right ) \ln \left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )-1\right )+\left (-1-\cos \left (2 b x +2 a \right )\right ) \ln \left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right )+2 \sin \left (b x +a \right )}{2 b \left (1+\cos \left (2 b x +2 a \right )\right )}\) \(78\)
norman \(\frac {\frac {\tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b}+\frac {\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )}{b}}{\left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )-1\right )^{2}}+\frac {\ln \left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )-1\right )}{2 b}-\frac {\ln \left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right )}{2 b}\) \(81\)

[In]

int(sec(b*x+a)^3*sin(b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

1/b*(1/2*sin(b*x+a)^3/cos(b*x+a)^2+1/2*sin(b*x+a)-1/2*ln(sec(b*x+a)+tan(b*x+a)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (30) = 60\).

Time = 0.30 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.79 \[ \int \sec (a+b x) \tan ^2(a+b x) \, dx=-\frac {\cos \left (b x + a\right )^{2} \log \left (\sin \left (b x + a\right ) + 1\right ) - \cos \left (b x + a\right )^{2} \log \left (-\sin \left (b x + a\right ) + 1\right ) - 2 \, \sin \left (b x + a\right )}{4 \, b \cos \left (b x + a\right )^{2}} \]

[In]

integrate(sec(b*x+a)^3*sin(b*x+a)^2,x, algorithm="fricas")

[Out]

-1/4*(cos(b*x + a)^2*log(sin(b*x + a) + 1) - cos(b*x + a)^2*log(-sin(b*x + a) + 1) - 2*sin(b*x + a))/(b*cos(b*
x + a)^2)

Sympy [F]

\[ \int \sec (a+b x) \tan ^2(a+b x) \, dx=\int \sin ^{2}{\left (a + b x \right )} \sec ^{3}{\left (a + b x \right )}\, dx \]

[In]

integrate(sec(b*x+a)**3*sin(b*x+a)**2,x)

[Out]

Integral(sin(a + b*x)**2*sec(a + b*x)**3, x)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.35 \[ \int \sec (a+b x) \tan ^2(a+b x) \, dx=-\frac {\frac {2 \, \sin \left (b x + a\right )}{\sin \left (b x + a\right )^{2} - 1} + \log \left (\sin \left (b x + a\right ) + 1\right ) - \log \left (\sin \left (b x + a\right ) - 1\right )}{4 \, b} \]

[In]

integrate(sec(b*x+a)^3*sin(b*x+a)^2,x, algorithm="maxima")

[Out]

-1/4*(2*sin(b*x + a)/(sin(b*x + a)^2 - 1) + log(sin(b*x + a) + 1) - log(sin(b*x + a) - 1))/b

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.41 \[ \int \sec (a+b x) \tan ^2(a+b x) \, dx=-\frac {\frac {2 \, \sin \left (b x + a\right )}{\sin \left (b x + a\right )^{2} - 1} + \log \left ({\left | \sin \left (b x + a\right ) + 1 \right |}\right ) - \log \left ({\left | \sin \left (b x + a\right ) - 1 \right |}\right )}{4 \, b} \]

[In]

integrate(sec(b*x+a)^3*sin(b*x+a)^2,x, algorithm="giac")

[Out]

-1/4*(2*sin(b*x + a)/(sin(b*x + a)^2 - 1) + log(abs(sin(b*x + a) + 1)) - log(abs(sin(b*x + a) - 1)))/b

Mupad [B] (verification not implemented)

Time = 0.55 (sec) , antiderivative size = 69, normalized size of antiderivative = 2.03 \[ \int \sec (a+b x) \tan ^2(a+b x) \, dx=\frac {{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^3+\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}{b\,\left ({\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2+1\right )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )\right )}{b} \]

[In]

int(sin(a + b*x)^2/cos(a + b*x)^3,x)

[Out]

(tan(a/2 + (b*x)/2) + tan(a/2 + (b*x)/2)^3)/(b*(tan(a/2 + (b*x)/2)^4 - 2*tan(a/2 + (b*x)/2)^2 + 1)) - atanh(ta
n(a/2 + (b*x)/2))/b